<template>
	<view class="mainpadding">
		<view class="margin_top6 sanshier fonweight">我的简介</view>
		<textarea class="textarea margin_top" placeholder="填写个人简介更容易获得别人关注哦~" v-model="bio"></textarea>
		<view class="gudingdb ffffff mainpadding">
			<view class="bigbtn" @click="save">提交</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				bio:""
			}
		},
		onLoad(opt) {
			if(opt.bio){
				this.bio = opt.bio
			}
		},
		methods: {
			save() {
				if (this.bio == "") {
					httpRequest.toast("请输入简介信息")
					return false
				}
				httpRequest.request('/api/user/profile', 'GET', {
					bio: this.bio
				}).then(res => {
					if (res.code == 1) {
						uni.navigateBack(1)
					}else{
						httpRequest.toast(res.msg)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.textarea{
	background: #F9F9F9;
	border-radius: 20rpx;
	padding: 30rpx;
	width: 100%;
	box-sizing: border-box;
}
</style>
